package com.szeldon.declatest.declaration.reader.settings;

import java.util.Map;

import com.szeldon.declatest.declaration.reader.exceptions.BadSettingsException;
import com.szeldon.declatest.declaration.settings.SettingsDeclaration;

/**
 * Interface for reader's plugins that support service-specific settings.
 * 
 * @author szeldon
 * 
 */
public interface ISettingsReaderPlugin {

    /**
     * Returns the name of a service supported by this plugin. For instance, "JMS" will be returned for a plugin that
     * supports settings for JMS service.
     * 
     * @return
     */
    public abstract String getSupportedServiceName();

    /**
     * Creates a service-specific settings declaration basing on provided of attributes.
     * 
     * @param id
     * @param description
     * @param settingsMap
     * @return
     * @throws BadSettingsException
     *             Thrown when given map doesn't contain sufficient information for this plugin.
     */
    SettingsDeclaration createSettingsDeclaration(String id, String description, Map<String, String> settingsMap)
            throws BadSettingsException;

}
